// 2025/3/30
// https://leetcode.cn/problems/jump-game/description/?envType=study-plan-v2&envId=top-100-liked
// 跳跃游戏

class Solution {
    public:
        bool canJump(vector<int>& nums) {
            int n = nums.size();
            int least = n - 1;
            for(int cur = n - 2; cur >= 0; cur--)
            {
                if(nums[cur] + cur >= least)
                    least = cur;
            }
            return least == 0;
        }
    };